#ifndef _EZNN_API_H_
#define _EZNN_API_H_

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

#ifndef MAX_DET_FACES_NUM
#define MAX_DET_FACES_NUM 256
#endif

#ifndef DEFAULT_FEATURE_SIZE
#define DEFAULT_FEATURE_SIZE 4096
#endif

#ifndef MAX_DET_HUM_NUM
#define MAX_DET_HUM_NUM  128
#endif

#ifndef MAX_MBG_BOX_NUM
#define MAX_MBG_BOX_NUM  256
#endif

#ifndef MAX_DET_LICPLATE_NUM
#define MAX_DET_LICPLATE_NUM 256
#endif

#ifndef MAX_REG_LICPLATE_LENGTH
#define MAX_REG_LICPLATE_LENGTH 10
#endif

#ifndef MAX_DET_PARKING_LINE_NUM
#define MAX_DET_PARKING_LINE_NUM 2
#endif


typedef enum EzaxImageFormat_e {
	EZAX_YUV420_SP = 0x02,
	EZAX_YVU420_SP = 0x04,
	EZAX_BGRA  = 0x09,
} ezax_img_fmt_e;


typedef struct ezax_imres {
	/* picture resolution */
	int w;
	int h;
} ezax_imres_t;


typedef struct ezax_freq {
	/*dev_id; freq*/
	int id;
	int freq;
} ezax_freq_t;


typedef struct ezax_face_kpts {
	float kpts[10];
} ezax_face_kpts_t;

typedef struct ezax_quadrilateral_kpts_rt {
	float kpts[8];
} ezax_quadrilateral_kpts_t;

typedef struct ezax_init_cfg {
	unsigned int width;
	unsigned int height;
	char *ezbStr;
	char *binStr;
} ezax_init_cfg_t;


typedef struct ezax_rt {
	/* left top */
	int x0;
	int y0;
	/* right bottom */
	int x1;
	int y1;
	/* class */
	int c;
	/* score */
	float s;
	/* id */
	int id;
	/* area */
	int area;
	/* exit */
	int exist;
	/* input extern information such as ezax_face_kpts_t */
	void *in_ex_inform;
	/* output extern information*/
	void *out_ex_inform;
	/* rsved */
	int rev;
} ezax_rt_t;


typedef struct ezax_boxes {
	/* roi boxes */
	ezax_rt_t *pRect;
	/* rect num */
	int num;
	/* */
	unsigned int nUID;
	/* rzv inform */
	void *rzv;
} ezax_boxes_t;


typedef struct ezax_img_handle {
	/* vir addr*/
	void *pVir;
	void *pVir_UV;
	/* phy addr*/
	unsigned int pPhy;
	unsigned int pPhy_UV;
	/* size */
	int sz;
	/* fmt */
	int fmt;
	/* iw */
	int w;
	/* ih */
	int h;
	/* channels */
	int c;
	/* wstride */
	int stride;
	/* color matrixs */
	int csc_mode;
} ezax_img_handle_t;

typedef struct ezax_img {
	/* img_handle */
	ezax_img_handle_t img_handle;
	/* valid roi */
	ezax_rt_t roi;
	/* input extern information such as ezax_face_kpts_t*/
	unsigned int nUID;
	/* reved */
	unsigned int rzv;
} ezax_img_t;


typedef struct ezax_img_batch {
	/* batch images */
	ezax_img_t *pImg;
	/* batch num */
	unsigned int nNum;
} ezax_img_batch_t;


typedef struct ezax_img_rois {
	/* img_handle */
	ezax_img_handle_t img_handle;
	/* valid roi */
	ezax_rt_t *roi;
	/* roi num */
	int roi_num;
	/* */
	unsigned int nUID;
	/* reserved */
	unsigned int rzv;
} ezax_img_rois_t;


/*********************************************************************
***************************face blur**********************************
*********************************************************************/

typedef struct ezax_faceblur_cfg {
	ezax_init_cfg_t base_init_cfg;
	unsigned int mask;
	ezax_freq_t freq;
} ezax_faceblur_cfg_t;

typedef enum ezax_faceblur_cmd {
	EZAX_FACEBLUR_RECONFIG_RES,
	EZAX_FACEBLUR_RESET_AXFREQ,
	EZAX_FACEBLUR_CLEAR_OUTBOX,
} ezax_faceblur_cmd_t;

typedef struct ezax_faceblur_rt {
	float face_blur;
} ezax_faceblur_rt_t;

void *nna_faceblur_open(ezax_faceblur_cfg_t *pcfg);
/* ezax_rt_t(in_ex_inform) --> ezax_face_kpts_t */
/* ezax_rt_t(out_ex_inform) --> ezax_faceblur_rt_t */
int nna_faceblur_process(void *hdl, ezax_img_rois_t *pImgRois, ezax_boxes_t *pfacesblur);
int nna_faceblur_cmd(void *hdl, ezax_faceblur_cmd_t cmd, unsigned int args);
int nna_faceblur_close(void *hdl);


/*********************************************************************
***************************face det**********************************
*********************************************************************/


typedef enum ezax_facedet_cmd {
	EZAX_FACEDET_RESET_AXFREQ,
	EZAX_FACEDET_GET_AXFREQ,
	EZAX_FACEDET_SET_CFG,
} ezax_facedet_cmd_t;

typedef struct eazx_facedet_cfg {
	unsigned int width;
	unsigned int height;
	char *model_rootpath; //base address
	int det_mode;
	int fdet_max_size;
	int fdet_min_size;
	ezax_rt_t roi;/*interest roi x, y, width, height*/
} ezax_facedet_cfg_t;

void *nna_facedet_open(ezax_facedet_cfg_t *cfg);
/* ezax_rt_t(out_ex_inform) --> ezax_face_kpts_t */
int nna_facedet_process(void *hdl, ezax_img_t *pImg, ezax_boxes_t *faces_det_out,
	float conf_thresh, float iou_thresh);
int  nna_facedet_cmd(void *hdl, ezax_facedet_cmd_t cmd, unsigned int args);
int  nna_facedet_close(void *hdl);


/*********************************************************************
***************************face quality**********************************
*********************************************************************/

typedef struct eazx_facequality_cfg {
	ezax_init_cfg_t base_init_cfg;
} ezax_facequality_cfg_t;

typedef struct ezax_facequality_rt {
	int quality_score;
} ezax_facequality_rt_t;

void *nna_facequality_open(ezax_facequality_cfg_t *cfg);
/* ezax_rt_t(in_ex_inform) --> ezax_face_kpts_t */
/* ezax_rt_t(out_ex_inform) --> ezax_facequality_rt_t */
int nna_facequality_process(void *hdl, ezax_img_rois_t *pFaceImgRois,
	ezax_boxes_t *pfacequality_out);
int nna_facequality_close(void *hdl);

/*********************************************************************
***************************face pose**********************************
*********************************************************************/

typedef struct eazx_headpose_cfg {
	ezax_init_cfg_t base_init_cfg;
} ezax_headpose_cfg_t;

typedef enum ezax_headpose_cmd {
	EZAX_HEADPOSE_RESET_AXFREQ,
	EZAX_HEADPOSE_GET_AXFREQ,
} ezax_headpose_cmd_t;

typedef struct ezax_headpose_rt {
	float head_pose[3];
	float head_pose_pts[3];
} ezax_headpose_rt_t;


void  *nna_headpose_open(ezax_headpose_cfg_t *cfg);
int  nna_headpose_process(void *hdl, ezax_img_rois_t *pFaceImgRois,
	ezax_boxes_t *pheadpose_out);
int nna_headpose_cmd(void *hdl, ezax_headpose_cmd_t cmd, unsigned int args);
int  nna_headpose_close(void *hdl);


/*********************************************************************
***************************face mask**********************************
*********************************************************************/

typedef struct eazx_facemask_cfg {
	ezax_init_cfg_t base_init_cfg;
	/* >thresh[0] wear mask, >thresh[1] warn mask not correctly */
	float thresh[2];
} ezax_facemask_cfg_t;

typedef enum ezax_facemask_cmd {
	/*/ezax_facemask_cfg_t*/
	EZAX_FACEMASK_SET_CFG,
} ezax_facemask_cmd_t;


typedef struct ezax_facemask_rt {
	int face_mask;
} ezax_facemask_rt_t;



void  *nna_facemask_open(ezax_facemask_cfg_t *cfg);
int  nna_facemask_process(void *hdl, ezax_img_rois_t *pFaceImgRois,
	ezax_boxes_t *pfacemask_out);
int  nna_facemask_close(void *hdl);
int  nna_facemask_cmd(void *hdl, ezax_facemask_cmd_t cmd, unsigned int args);

/*********************************************************************
***************************living det*********************************
*********************************************************************/

typedef struct ezax_livingdet_rt {
	int live_score;
} ezax_livingdet_rt_t;

typedef enum ezax_livingdet_cmd {
	EZAX_LIVINGDET_RESET_AXFREQ,
	EZAX_LIVINGDET_GET_AXFREQ,
	EZAX_LIVINGDET_SET_NIRAVGLUMRATE,
	EZAX_LIVINGDET_SET_MASK,
	EZAX_LIVINGDET_SET_REFRESH,
} ezax_livingdet_cmd_t;

typedef struct ezax_livingdet_cfg {
	char *model_rootpath;  //base address
	ezax_freq_t freq;
	float rgb_exposure_time_rate;
	float rgb_exposure_dark_rate;
	int single_rgb_model;
	int living_color_enable;
	int mask_en;
	int mask_living_enable;
	float nir_avg_lum_rate; // for nir image
	int living_confidence_thr;
	int livingdet_mode;
} ezax_livingdet_cfg_t;

void *nna_livingdet_open(ezax_livingdet_cfg_t *cfg);
int nna_livingdet_process(void *hdl, ezax_img_t *nir_face, ezax_img_t *rgb_face,
	ezax_rt_t *living_det_out);
int nna_livingdet_cmd(void *hdl, ezax_livingdet_cmd_t cmd, unsigned int args);
int nna_livingdet_close(void *hdl);


/*********************************************************************
***************************face reg*********************************
*********************************************************************/

typedef struct ezax_facereg_cfg {
	ezax_init_cfg_t base_init_cfg;
	unsigned int mask;
	ezax_freq_t freq;
} ezax_facereg_cfg_t;

typedef enum ezax_facereg_cmd {
	EZAX_FACEREG_RECONFIG_RES,
	EZAX_FACEREG_RESET_AXFREQ,
	EZAX_FACEREG_GET_AXFREQ,
	EZAX_FACEREG_COMPARE,
} ezax_facereg_cmd_t;


typedef struct ezax_face_feature {
	void *feature_ref;
	int feature_size;
	int dtype;//2: int8,4: int16
	float norm_value;
	unsigned int nUID;
} ezax_face_feature_t;

typedef struct ezax_face_compare {
	void *features;
	int features_num;
	float *features_norm;

	void *feature_ref;

	int feature_part;
	int feature_size;
	int feature_cmp_size;
	float *score;
	int max_id[3];
	int dtype;
} ezax_face_compare_t;


void *nna_facerecg_open(ezax_facereg_cfg_t *cfg);
int nna_facerecg_process(void *hdl, ezax_img_t *pImgRoi, ezax_face_feature_t *frecg_out);
int nna_facerecg_cmd(void *hdl, ezax_facereg_cmd_t cmd, unsigned int args);
int nna_facerecg_close(void *hdl);


/*********************************************************************
***************************face track*********************************
*********************************************************************/


typedef enum ezax_facetrk_cmd {
	/*set face track config, args: ezax_facetrack_cfg_t */
	EZAX_FACETRK_SET_CFG = 0x1,
	EZAX_FACETRK_CLEAR_ALL_IDS = 0x2,
} ezax_facetrk_cmd_t;


typedef struct eazx_facetrack_cfg {
	unsigned int width;
	unsigned int height;
	char *model_rootpath;
	int max_track_frames;
	int max_track_faces;
	int visual_track_thresh;
	int use_fast_track;
	float new_target_thresh;/*add new target when detect score>new_target_thresh*/
	float match_thresh;/*0.2-1.0f*/
	int   max_lost_hold_num;/*0-100*/
	float lost_hold_rematch_thresh;/*0-1*/
	int save_last_buffer;
	int max_roi_dt_run_num;
	int max_visual_tk_run_num;
	int visual_tk_base_size;
} ezax_facetrack_cfg_t;

typedef struct ezax_facetrack_rt {
	ezax_face_kpts_t face_kpts;
	int facetrk_flag;
	int box_smooth[4];
} ezax_facetrack_rt_t;

void *nna_facetrack_open(ezax_facetrack_cfg_t *cfg);
int nna_facetrack_process(void *hdl, ezax_img_rois_t *pImgRois,
	ezax_boxes_t *faces_track);
int nna_facetrack_close(void *hdl);
int nna_facetrack_cmd(void *hdl, ezax_facetrk_cmd_t cmd, unsigned int args);

/*********************************************************************
****************************  pep det *******************************
*********************************************************************/

typedef enum ezax_humdet_cmd {
	/* Re-Set input resolution */
	EZAX_HUMDET_RECONFIG_RES = 0x1,
	/* Release ezax_boxes_t after humoid_run */
	EZAX_HUMDET_RELEASE_BOXESBUF = 0x2,
	/* Re-Set trkcfg */
	EZAX_HUMDET_RECONFIG_TRKCFG = 0x3,
	/* Re-Set frequency */
	EZAX_HUMDET_RESET_AXFREQ = 0x4,
	/* Get frequency */
	EZAX_HUMDET_GET_AXFREQ = 0x5,
} ezax_humdet_cmd_t;

typedef struct ezax_humdet_cfg {
	ezax_init_cfg_t base_init_cfg;
	ezax_freq_t freq;
} ezax_humdet_cfg_t;

void *nna_humoid_open(ezax_humdet_cfg_t *cfg);
int nna_humoid_process(void *hdl, ezax_img_t *pIn, ezax_boxes_t *pOut, float conf_thr,
	float iou_thr);
int nna_humoid_close(void *hdl);
int nna_humoid_cmd(void *hdl, ezax_humdet_cmd_t cmd, unsigned int args);

/*********************************************************************
**************************** pep track ******************************
*********************************************************************/

typedef struct ezax_peptrk_cfg {
	int  color_fmt;
	int  visual_track_thresh;
	int  max_track_objs;
	int  max_track_frames;
	int  use_fast_track;
	float new_target_thresh;/*add new target when detect score>new_target_thresh*/
	float match_thresh;/*0.2-1.0f*/
	int   max_lost_hold_num;/*0-100*/
	float lost_hold_rematch_thresh;/*0-1*/
	int save_last_buffer;
	int max_visual_tk_run_num;
	int visual_tk_base_size;
	int  rev[5];
} ezax_peptrk_cfg_t;

typedef enum ezax_humtrack_cmd {
	/* Re-Set trkcfg */
	EZAX_NNA_PEPTRACK_RECONFIG_TRKCFG = 0x3,
} ezax_humtrack_cmd_t;


typedef struct ezax_plptrack_ex {
	/*match input index, -1 for matching nobody*/
	int is_visual_track;
	int box_smooth[4];
} ezax_plptrack_ex_t;


void *nna_plptrack_open(ezax_peptrk_cfg_t *cfg);
int nna_plptrack_process(void *hdl, ezax_img_rois_t *pImgRois, ezax_boxes_t *peds_track);
int nna_plptrack_cmd(void *hdl, unsigned int cmd, unsigned int args);
int nna_plptrack_close(void *hdl);


/*********************************************************************
**************************** mbg md **********************************
*********************************************************************/

typedef struct ezax_mbg_md_cfg_s {
	int fmt_in; // input image format, 2:YUV420_SP  9:NNA_BGRA
	int iw;  // input image width
	int ih; // input image height
	int fg_thr; // foreground filter threshold value, suggest setting range [5, 70]
	int dilate_times; // do dilate times, suggest setting range [1, 5], if msk_filter_strength>0, dilate_times recommend the val set above 1
	int msk_filter_strength;  // msk foreground picture do filter in vertical direction, 0: no filter 1: low-strength  2: mid-strength  3: high-strength
} ezax_mbg_md_cfg_t;


typedef enum ezax_mbgs_cmd {
	/* Re-Set input attr params */
	EZAX_MBGS_RECONFIG_ATTR = 0x1,

	EZAX_MBGS_RECONFIG_PARAM = 0x6,

	EZAX_MBGS_RESET_AXFREQ   = 0x8,
	EZAX_MBGS_GET_AXFREQ     = 0x9,
	EZAX_MBGS_GET_AREA_THRESHOLD = 0xa,
	EZAX_MBGS_GET_PARAM          = 0xb,
} ezax_mbgs_cmd_t;


typedef struct ezax_mbg_param {
	int input_width;
	int input_height;
	/*! POOLING BLK_W/BLK_H */
	int pool_w;
	int pool_h;
	/*! FG MASK Threshold */
	int threshold_enable;
	int threshold;
	/*! BG update alpha */
	int alpha;
	/*! Scene change */
	int reset_flag;
	/*! Pooling mask threshold */
	int mask_threshold;
} ezax_mbg_param_t;

void *nna_mbgs_md_open(ezax_mbg_md_cfg_t *pconfig);
int  nna_mbgs_md_cmd(void *hdl, ezax_mbgs_cmd_t cmd, unsigned int args);
int nna_mbgs_md_process(void *hdl, ezax_img_t *p_in, ezax_boxes_t *ccl_box);
int nna_mbgs_md_close(void *hdl);


/********************************************************************
**************************** face attrs *****************************
*********************************************************************/

typedef enum ezax_faceattr_gender {
	EZAX_FACEATTR_GENDER_INIT,
	EZAX_FACEATTR_GENDER_FEMALE,
	EZAX_FACEATTR_GENDER_MALE,
} ezax_faceattr_gender_e;

typedef struct ezax_faceattr_cfg_s {
	char *model_rootpath;
	int   model_type;
	int enable_age_det;
	int enable_gender_det;
} ezax_faceattr_cfg_t;

typedef struct ezax_faceattr_rt_s {
	int age;
	ezax_faceattr_gender_e  gender;
} ezax_faceattr_rt_t;


typedef enum ezax_faceattr_cmd {
	EZAX_FACEATTR_RESET_AXFREQ,
	EZAX_FACEATTR_GET_AXFREQ,
} ezax_faceattr_cmd_t;


void *nna_faceattr_open(ezax_faceattr_cfg_t *pconfig);
int  nna_faceattr_cmd(void *hdl, ezax_faceattr_cmd_t cmd, unsigned int args);
int nna_faceattr_process(void *hdl, ezax_img_rois_t *p_in, ezax_boxes_t *faces_attr_box);
int nna_faceattr_close(void *hdl);


/********************************************************************
**************************** face clarity ***************************
*********************************************************************/

typedef enum ezax_faceclarity_level {
	CLARITY_LEVLE0,
	CLARITY_LEVLE1,
	CLARITY_LEVLE2,
	CLARITY_LEVLE3,
	CLARITY_LEVLE4,
	CLARITY_LEVLE5,
	CLARITY_LEVLE6,
	CLARITY_LEVLE7,
} ezax_faceclarity_level_e;


typedef struct ezax_faceclarity_cfg_s {
	ezax_init_cfg_t base_init_cfg;;
} ezax_faceclarity_cfg_t;

typedef struct ezax_faceclarity_rt {
	int faceclarity_score;
	ezax_faceclarity_level_e faceclarity_level;
} ezax_faceclarity_rt_t;

typedef enum ezax_faceclarity_cmd {
	EZAX_FACECLARITY_RESET_AXFREQ,
	EZAX_FACECLARITY_GET_AXFREQ,
} ezax_faceclarity_cmd_t;

void *nna_faceclarity_open(ezax_faceclarity_cfg_t *pconfig);
int  nna_faceclarity_cmd(void *hdl, ezax_faceclarity_cmd_t cmd, unsigned int args);
int nna_faceclarity_process(void *hdl, ezax_img_rois_t *pImgRois,
	ezax_boxes_t *faces_track);
int nna_faceclarity_close(void *hdl);

/********************************************************************
**************************** sface det ***************************
*********************************************************************/

typedef struct eazx_sfacedet_cfg {
	ezax_init_cfg_t base_init_cfg;
	int fmt;
} ezax_sfacedet_cfg_t;

typedef enum ezax_sfacedet_cmd {
	EZAX_SFACECDET_RESET_AXFREQ,
	EZAX_SFACECDET_GET_AXFREQ,
} ezax_sfacedet_cmd_t;

void *nna_sfacedet_open(ezax_sfacedet_cfg_t *cfg);
int  nna_sfacedet_cmd(void *hdl, ezax_sfacedet_cmd_t cmd, unsigned int args);
int nna_sfacedet_process(void *hdl, ezax_img_t *pImg, ezax_boxes_t *faces_det_out,
	float conf_thresh, float iou_thresh);
int  nna_sfacedet_close(void *hdl);


/********************************************************************
**************************** license plate det **********************
*********************************************************************/

typedef enum ezax_licplate_det_mode {
	EZAX_LIC_PLATE_DET_MODE_UP,
	EZAX_LIC_PLATE_DET_MODE_IDOWN,
} ezax_licplate_det_mode_t;


typedef struct eazx_licplate_det_cfg {
	unsigned int width;
	unsigned int height;
	char *model_rootpath;
	ezax_licplate_det_mode_t det_mode;
} ezax_licplate_det_cfg_t;


typedef enum ezax_licplate_det_cmd {
	EZAX_LIC_PLATE_DET_RESET_AXFREQ,
	EZAX_LIC_PLATE_DET_GET_AXFREQ,
} ezax_licplate_det_cmd_t;


void *nna_licplate_det_open(ezax_licplate_det_cfg_t *cfg);
int  nna_licplate_det_cmd(void *hdl, ezax_licplate_det_cmd_t cmd, unsigned int args);
int  nna_licplate_det_process(void *hdl, ezax_img_t *pImg, ezax_boxes_t *licplate_det_out,
	float conf_thresh, float iou_thresh);
int  nna_licplate_det_close(void *hdl);


/********************************************************************
**************************** generic func ***************************
*********************************************************************/

typedef struct ezax_generic_func_scale_param {
	ezax_img_t *in_img;
	ezax_img_t *out_img;
} ezax_generic_func_scale_param_t;

typedef enum ezax_generic_func_cmd {
	EZAX_GENERIC_FUNC_SCALE,
	EZAX_GENERIC_ALLOC_NDK_BUFFER,
	EZAX_GENERIC_FREE_NDK_BUFFER,
} ezax_generic_func_cmd_t;

void *nna_generic_func_open(void);
int  nna_generic_func_cmd(void *hdl, ezax_generic_func_cmd_t cmd, unsigned int args);
int  nna_generic_func_close(void *hdl);

/********************************************************************
**************************** face occlude ***************************
*********************************************************************/

typedef enum ezax_decision_mode {
	EZAX_DECISION_MODE_COMMON,
} ezax_decision_mode_t;


typedef struct ezax_faceocclude_cfg_s {
	unsigned int width;
	unsigned int height;
	char *model_rootpath;
	int model_type;
	int decision_mode;
} ezax_faceocclude_cfg_t;


typedef struct ezax_faceocclude_rt_s {
	float occlude_ratio;
	float glasses_probability;
	float mask_probability;
} ezax_faceocclude_rt_t;


typedef enum ezax_faceocclude_cmd {
	EZAX_FACEOCCLUDE_RESET_AXFREQ,
	EZAX_FACEOCCLUDE_GET_AXFREQ,
	EZAX_FACEOCCLUDE_GET_OUT_FACE_KPTS,
	EZAX_FACEOCCLUDE_GET_MASK_BIN_SIZE,
	EZAX_FACEOCCLUDE_GET_MASK_BIN_BUF,
} ezax_faceocclude_cmd_t;


typedef struct ezax_square_mode_param_s {
	int x0;
	int y0;
	int x1;
	int y1;
} ezax_square_mode_param_t;


typedef enum ezax_calculation_mode {
	EZAX_CALCULATION_MODE_SQUARE,
} ezax_calculation_mode_t;


typedef struct ezax_faceocclude_process_param_s {
	int num;
	int calculate_mode;
	void *param;
} ezax_faceocclude_process_param_t;


void *nna_faceocclude_open(ezax_faceocclude_cfg_t *pconfig);
int  nna_faceocclude_cmd(void *hdl, ezax_faceocclude_cmd_t cmd, unsigned int args);
int nna_faceocclude_process(void *hdl, ezax_img_t *p_in,
	ezax_rt_t *faceocclude_out, ezax_faceocclude_process_param_t *process_param);
int nna_faceocclude_close(void *hdl);


/********************************************************************
**************************** parking line det ***********************
*********************************************************************/

typedef struct ezax_parkingline_det_cfg_s {
	unsigned int width;
	unsigned int height;
	char *model_rootpath;
	unsigned int det_mode;
} ezax_parkingline_det_cfg_t;


typedef struct ezax_line_info_s {
	float left_line_dist;
	float right_line_dist;
	float line_width;
	float line_middle_width;
	int line_slope;
	float line_ratio_length;
} ezax_line_info_t;


typedef struct ezax_parkingline_det_rt_s {
	ezax_line_info_t *lineinfos;
	int det_line_size;
} ezax_parkingline_det_rt_t;


typedef enum ezax_parkingline_det_cmd {
	EZAX_PARKINGLINE_DET_RESET_AXFREQ,
	EZAX_PARKINGLINE_DET_GET_AXFREQ,
} ezax_parkingline_det_cmd_t;


typedef struct ezax_parkingline_process_param_s {
	float center_x;
	float center_y;
	float b_width;
	float d_point_ration;
} ezax_parkingline_process_param_t;

void *nna_parkingline_det_open(ezax_parkingline_det_cfg_t *pconfig);
int  nna_parkingline_det_cmd(void *hdl, ezax_parkingline_det_cmd_t cmd,
	unsigned int args);
int nna_parkingline_det_process(void *hdl, ezax_img_t *p_Img,
	ezax_rt_t *parkingline_det_out, ezax_parkingline_process_param_t *process_param);
int nna_parkingline_det_close(void *hdl);

/*********************************************************************
****************************  pepface det *******************************
*********************************************************************/

typedef enum ezax_humface_det_class {
	INVALID,
	HUMCLASS,
	FACECLASS
} ezax_humface_det_class_t;

typedef enum ezax_humface_det_cmd {
	/* Re-Set frequency */
	EZAX_HUMFACEDET_RESET_AXFREQ = 0x4,
	/* Get frequency */
	EZAX_HUMFACEDET_GET_AXFREQ = 0x5,
} ezax_humface_det_cmd_t;

typedef struct ezax_humface_det_cfg {
	unsigned int width;
	unsigned int height;
	char *model_rootpath;
	int enable_hum_det;
	int enable_face_det;
	int model_type;
} ezax_humface_det_cfg_t;

void *nna_humface_det_open(ezax_humface_det_cfg_t *cfg);
int nna_humface_det_process(void *hdl, ezax_img_t *pIn, ezax_boxes_t *pOut,
	float conf_thr, float iou_thr);
int nna_humface_det_close(void *hdl);
int nna_humface_det_cmd(void *hdl, ezax_humface_det_cmd_t cmd, unsigned int args);


/********************************************************************
**************************** license plate recg **********************
*********************************************************************/

typedef struct eazx_licplate_recg_cfg {
	ezax_init_cfg_t base_init_cfg;
} ezax_licplate_recg_cfg_t;


typedef enum ezax_licplate_recg_cmd {
	EZAX_LIC_PLATE_RECG_RESET_AXFREQ,
	EZAX_LIC_PLATE_RECG_GET_AXFREQ,
} ezax_licplate_recg_cmd_t;

typedef struct ezax_licplate_recg_rt_s {
	unsigned short *data;
	int licplate_length;
	float score;
	unsigned int color_index;
} ezax_licplate_recg_rt_t;

void *nna_licplate_recg_open(ezax_licplate_recg_cfg_t *cfg);
int  nna_licplate_recg_cmd(void *hdl, ezax_licplate_recg_cmd_t cmd, unsigned int args);
int  nna_licplate_recg_process(void *hdl, ezax_img_t *pImg, ezax_rt_t *licplate_recg_out);
int  nna_licplate_recg_close(void *hdl);


#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif
